/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.uniminuto.park.dao;


import co.uniminuto.park.clases.Roles;
import co.uniminuto.park.clases.Usuario;
import co.uniminuto.park.variables.VariablesGlobales;
import com.google.code.morphia.Datastore;
import com.google.code.morphia.Morphia;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Esteban Rozo
 */
public class insertarUsuarioDao extends ConexionMongo{
    
    private Morphia morphia;
    private Datastore ds;

    public Morphia getMorphia() {
        return morphia;
    }

    public void setMorphia(Morphia morphia) {
        this.morphia = morphia;
    }

    public Datastore getDs() {
        return ds;
    }

    public void setDs(Datastore ds) {
        this.ds = ds;
    }
    
    public insertarUsuarioDao(){super();}
    
    
    public void insertaUsuario(Usuario user){
    this.morphia= new Morphia();
    this.morphia.map(Usuario.class);
    this.ds=this.morphia.createDatastore(super.conectar(), VariablesGlobales.nombreBD);
    this.ds.ensureIndexes();
    this.ds.save(user);
    }
    
   
        public static void main(String args[]) {
            insertarUsuarioDao in= new insertarUsuarioDao();
            
           
               
           
        }
    
    
    
    
}
